<!--COLUMN 1-->
<div class="ThreeColGrid_c1">
<div id="output" class="myAvatar">
<?php 
            if($this->data['Store']['Avatar'])
            {
                echo '<img src="'. Router::url('/').'app/webroot/img/avatar/'.$this->data['Store']['Avatar'].'" width="100" alt="Locum">';
            }else
            {
                echo '<img src="'.Router::url('/').'app/webroot/img/avatar.jpg" width="100" alt="Locum">';
            }
?>
</div>

<a href="javascript:void(0)" id='UploadImage' class="TitleFive">edit image</a> 

<div class="hide" id="upload-block">
<?php echo $form->create('Store', array('action'=>'upload_avatar','id'=>'FileUploader','type'=>'post','enctype' => 'multipart/form-data'));?>
<?php echo $form->input('mFile',array('label'=>'','div'=>'','type'=>'file','size'=>2)); ?>
<button type="submit" class="red-button" id="uploadButton">Upload</button>
<?php echo $form->end()?>
</div>

</div>
<!--COLUMN 1-->

<!--COLUMN 2-->
<div class="ThreeColGrid_c2">
<?php $session->flash(); ?>    
<?php echo $form->create('Store',array('action' => 'edit'));?>  
<?php echo $form->input('id',array('label'=>'','div'=>'','type'=>'hidden')); ?>
<?php echo $form->input('Avatar',array('label'=>'','div'=>'','type'=>'hidden')); ?>
<?php echo $form->input('MatchMemberSince',array('label'=>'','div'=>'','type'=>'hidden')); ?>
<?php echo $form->input('LastLoggedIn',array('label'=>'','div'=>'','type'=>'hidden')); ?>
<?php echo $form->input('Openinghours',array('label'=>'','div'=>'','type'=>'hidden')); ?>

<table border="0" cellspacing="0" cellpadding="0">

<tr>
<td valign="top" width="200"><b>Username</b></td>
<td valign="top" width="200"><?php echo $form->input('Username',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Pharmacy name</b></td>
<td valign="top" width="200"><?php echo $form->input('PharmacyName',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Address</b></td>
<td valign="top" width="200"><?php echo $form->input('Address', array('type' => 'textarea','label'=>'','escape' => false,'rows'=>5,'cols'=>30));?></td>
</tr>

<tr>
<td valign="top" width="200"><b>County</b></td>
<td valign="top" width="200">
<select name="data[Store][Country_id]" id="UserCountry">
<?php
                      $temp ='';
                      foreach ($GLOBALS['Counties'] as $group=>$countries)
                      {
                           if($group != $temp)
                           {
                                echo  '<optgroup label="'.$group.'">'  ;
                           }
                           foreach ($countries as $k=>$country) 
                           {
                                if($this->data['Store'][Country_id] == $k)
                                    echo  ' <option value="'.$k.'" selected="selected">'.$country.'</option>'   ;
                                else
                                    echo  ' <option value="'.$k.'">'.$country.'</option>'   ;
                           }
                           
                           $temp = $group;
                      }
                ?>
</select>
</td>
</tr>

<tr>
<td valign="top" width="200"><b>Postcode</b></td>
<td valign="top" width="200"><?php echo $form->input('Postcode',array('label'=>'','div'=>'')); ?>
<span class="noteTwo">Postcode + space + street (Ex: CW12 2AT)</span>  
</td>
</tr>

<tr>
<td valign="top" width="200"><b>Email</b></td>
<td valign="top" width="200"><?php echo $form->input('Email',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Telephone</b></td>
<td valign="top" width="200"><?php echo $form->input('Telephone',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Fax</b></td>
<td valign="top" width="200"><?php echo $form->input('Fax',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200" style="display: block; margin:0 0 10px 0;"><b>Match member since</b></td>
<td valign="top" width="200"><?php echo date('y-m-d',strtotime($this->data['Store']['MatchMemberSince']))?></td>
</tr>

<tr>
<td valign="top" width="200" style="display: block; margin:0 0 10px 0;"><b>Last logged in</b></td>
<td valign="top" width="200"><?php echo date('y-m-d',strtotime($this->data['Store']['LastLoggedIn']))?></td>
</tr>

<tr>
<td valign="top" width="200"><b>GPHC Number</b></td>
<td valign="top" width="200"><?php echo $form->input('GPHCNumber',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Pharmacist reg date</b></td>
<td valign="top" width="200"><?php echo $form->input('DateOfPharmacist',array('type'=>'text','label'=>'','div'=>'')); ?></td>
</tr>
  
<tr>
<td valign="top" width="200"><b>IT compatibility</b></td>
<td valign="top" width="200">
<?php
       if(is_array($this->data['Store']['ITCompatibility']))
       {
         $this->data['Store']['ITCompatibility'] = implode(',',$this->data['Store']['ITCompatibility']);
       }
       
       echo $form->select('ITCompatibility',$GLOBALS['ITCompatibility'],explode(',',$this->data['Store']['ITCompatibility']),array('multiple'=>true,'label'=>'','div'=>''),false);
       
?>
</td>          
</tr>

<tr>
<td valign="top" width="200"><b>EPS1 ready</b></td>
<td valign="top" width="200">Yes <?php echo $form->checkbox('EPS1Ready',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>EPS2 ready</b></td>
<td valign="top" width="200">Yes <?php echo $form->checkbox('EPS2Ready',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Opening hours</b></td>
<td valign="top" width="200">

<table border="0" cellspacing="0" cellpadding="0">
<?php 
         $a_Openinghours = explode(',',$this->data['Store']['Openinghours']);
         $sz_selected ="selected='selected'";
         foreach($GLOBALS['Days'] as $k=>$day){
                     $a_Hours = split('-',$a_Openinghours[$k -1]);
?>
<tr>
<td valign="top" width="200"><?php echo $day.':'?></td>
<td valign="top" width="200">
<select name = "data[Store][<?php echo $day?>][from]">  
<?php foreach($GLOBALS['OpeningHours'] as $openingHours){?>
<option value="<?php echo $openingHours?>" <?php if($a_Hours[0] == $openingHours) echo $sz_selected ?> ><?php echo $openingHours?></option>
<?php }?>
</select> -
</td>
<td valign="top" width="200">
<select name = "data[Store][<?php echo $day?>][to]">   
<?php foreach($GLOBALS['OpeningHours'] as $openingHours){?>
<option value="<?php echo $openingHours?>" <?php if($a_Hours[1] == $openingHours) echo $sz_selected ?>><?php echo $openingHours?></option>
<?php }?>    
</select>
</td>
</tr>

<?php } ?>
</table>

</td>
</tr>

<tr>
<td valign="top" width="200"><b>Lunch closure</b></td>
<td valign="top" width="200"><?php echo $form->checkbox('LunchClosure',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Free parking</b></td>
<td valign="top" width="200"><?php echo $form->checkbox('FreeParking',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Prescription items</b></td>
<td valign="top" width="200"><?php echo $form->select('PrescriptionItems',$GLOBALS['PrescriptionItems'],null,array('label'=>'','div'=>''),false); ?></td>
</tr>
<tr>
<td valign="top" width="200"><b>Staff</b></td>
<td valign="top" width="200"><?php
        if(is_array($this->data['Store']['Staff']))
        {
             $this->data['Store']['Staff'] = implode(',',$this->data['Store']['Staff']);
        }
         echo $form->select('Staff',$GLOBALS['Staff'],explode(',',$this->data['Store']['Staff']),array('multiple'=>true,'label'=>'','div'=>''),false); ?>
<span class="noteTwo">Ctrl + click to select multiple items</span> 
</td>          
</tr>

<tr>
<td valign="top" width="200"><b>Consultation room</b></td>
<td valign="top" width="200">Yes <?php echo $form->checkbox('ConsultationRoom',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Community dossette patients #</b></td>
<td valign="top" width="200"><?php echo $form->input('CommunityDossettePatients',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Servicing of care homes #</b></td>
<td valign="top" width="200"><?php echo $form->input('Servicing',array('label'=>'','div'=>'')); ?></td>
</tr>

<tr>
<td valign="top" width="200"><b>Essential services</b></td>
<td valign="top" width="200">
<?php
        if(is_array($this->data['Store']['EssentialServices']))
        {
            $this->data['Store']['EssentialServices'] = implode(',',$this->data['Store']['EssentialServices']);
        }
         echo $form->select('EssentialServices',$GLOBALS['EssentialServices'],explode(',',$this->data['Store']['EssentialServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
<span class="noteTwo">Ctrl + click to select multiple items</span> 
</td>          
</tr>

<tr>
<td valign="top" width="200"><b>Advanced services</b></td>
<td valign="top" width="200">
<?php 
        if(is_array($this->data['Store']['AdvancedServices']))
        {
          $this->data['Store']['AdvancedServices'] = implode(',',$this->data['Store']['AdvancedServices']);
        }
        echo $form->select('AdvancedServices',$GLOBALS['AdvancedServices'],explode(',',$this->data['Store']['AdvancedServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
<span class="noteTwo">Ctrl + click to select multiple items</span> 
</td>          
</tr>

<tr>
<td valign="top" width="200"><b>Enhanced services</b></td>
<td valign="top" width="200">
<?php 
         if(is_array($this->data['Store']['EnhancedServices']))
        {
          $this->data['Store']['EnhancedServices'] = implode(',',$this->data['Store']['EnhancedServices']);
        }
        echo $form->select('EnhancedServices',$GLOBALS['EnhancedServices'],explode(',',$this->data['Store']['EnhancedServices']),array('label'=>'','div'=>'','multiple'=>true),false); ?>
<span class="noteTwo">Ctrl + click to select multiple items</span> 
</td>          
</tr>

<tr>
<td valign="top" width="200"><b>Patient Group Directives</b></td>
<td valign="top" width="200"><?php echo $form->textarea('PatientGroupDirectives',array('label'=>'','div'=>'','cols'=>30,'rows'=>5)); ?></td>
</tr>

<tr>
<td valign="top" width="200"><?php echo $form->submit();?></td>
<td valign="top" width="200">&nbsp;</td>
</tr>

</table>

<?php echo $form->end(); ?>
</div>
<!--COLUMN 2-->

<!--COLUMN 3-->
<div class="ThreeColGrid_c3">
<h6 class="TitleFive">Locum Search</h6>
<?php
	if($UserType == 3)
		echo $this->element('search');
	else
		echo $this->element('search_for_pharmacy');
?>
<?php 
if($user_type == 3)
	echo $this->element('store_applicants');
?>
</div>
<!--COLUMN 3-->